/*
 * Date：10/23/18 10:15 PM
 * Author: guomw
 *
 */

package org.elanfox.intellicommunity.biz.service.core.equipment;


import org.elanfox.intellicommunity.biz.entity.equipment.BaseStationPO;
import org.elanfox.intellicommunity.data.base.base.SearchableCrudService;
import org.elanfox.intellicommunity.msg.ienum.BaseStationType;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.Map;

/**
 * 基站Service
 *
 * @author loutianix
 * @date 2019-12-09
 */
public interface BaseStationService extends SearchableCrudService<BaseStationPO, Integer> {

    /**
     * 修改启动状态
     *
     * @param baseStationId
     * @return
     */
    boolean updateEnable(Integer baseStationId);

    boolean deleteByNo(Long no);

    /**
     * 更新防拆卸状态
     *
     * @param baseStationId
     * @return
     */
    boolean updateDismantleStatus(Integer baseStationId);

    /**
     * 根据阅读器地址得到基站实例
     *
     * @param deviceAddr
     * @return
     */
    BaseStationPO findByDeviceAddr(long deviceAddr, BaseStationType stationType);

    /**
     * 设置低频参数
     *
     * @param stationId
     * @param scope
     */
    void setLfScope(Integer stationId, int scope);

    /**
     * 设置433M的RSSI过滤功能
     *
     * @param stationId
     * @param enabled
     * @param limitVal
     */
    void setRssiLimit(Integer stationId, boolean enabled, int limitVal);

    /**
     * 设置设备过滤等待时间
     *
     * @param stationId
     * @param enabled
     */
    void setBuzzerStatus(Integer stationId, boolean enabled);

    /**
     * 设置设备地址
     *
     * @param stationId
     * @param deviceAddr
     */
    void setDeviceAddr(Integer stationId, long deviceAddr);

    /**
     * 设置设备过滤等待时间
     *
     * @param stationId
     * @param interval
     */
    void setFilterTime(Integer stationId, int interval);

    void lead(MultipartFile updateFile) throws IOException;

    Map<String,Long> count();
}
